/**
 * Created by Administrator on 2015/2/7.
 */
"use strict";
var loginApp = angular.module("app.login", []);
loginApp.controller("login",['$scope','$http','$location','$timeout',function($scope,$http,$location,$timeout){
$scope.loginInfo = {};$scope.loginInfo.username = 'admin';$scope.loginInfo.password = '666666';document.getElementById('save').checked = true;
$scope.brand = '1.9.5';$scope.login = function(){$http({method  : 'post', url     : 'login/oauth', data    : $.param($scope.loginInfo),
headers : { 'Content-Type': 'application/x-www-form-urlencoded' }}).success(function(data){
if(!data.ret_data) $scope.login_error = data.ret_msg; else location.href = 'home';
}).error(function(data){$scope.login_error = '服 务 器 繁 忙 稍 后 再 试';});$timeout(function(){$scope.login_error = '';},5000);}
}]);loginApp.controller("crosslogin",['$scope','$location','$timeout',function($scope,$location,$timeout){
$scope.time = 3;setInterval(function() {$scope.time--;$scope.$digest(); // 通知视图模型的变化
}, 1000);$timeout(function(){location.href = 'login'},3000);
}]);


